Skip to content

test(backspace): golden-master backspace corpus for #31 (#21)#72

Merged
AsafMah merged 1 commit into
devfrom
feat/a3b-backspace-corpus
Jun 10, 2026
Merged

test(backspace): golden-master backspace corpus for #31 (#21)#72
AsafMah merged 1 commit into
devfrom
feat/a3b-backspace-corpus

Conversation

@AsafMah

@AsafMah AsafMah commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Closes #21. The safety net for the #31 backspace-stack refactor.

What

Adds 10 backspace regression tests to InputLogicTest (reuses the existing Robolectric harness — no new shadows), each documenting the user-facing behavior contract it locks:

  • default per-char delete — composing word, after committed word + space, and recompose-into-previous-word (earlier words untouched)
  • precool corruption guard — the PR-Two-thumb typing: manual-spacing fixes, live-converge, backspace corr… #11 class: combining whole-word delete of "cool" in "This is pretty cool" must not mash to "This is precool"
  • combining whole-word delete mid-sentence — no word-mash into preceding text
  • cursor-in-middle recompose — backspace commits then deletes one char
  • legacy fragment-pop (manual-spacing) — pops one fragment, not the whole word
  • two monotonicity invariants — a run of backspaces never re-gains earlier characters

Why observable-only

Assertions check editor text + composing text, never internal fields. #31 deletes mGestureFragmentBoundaries, so asserting boundary lists would be a false regression signal — these tests survive a behavior-preserving refactor by design.

Notes

  • 1 test (@Ignore) covers multi-stroke gesture-extension fragment-pop — the JVM harness can't simulate combining-mode extension across two gestureInput() calls (they append, not extend → "techtechnology"); documented expected-vs-actual for on-device verification.
  • During authoring, two cases surfaced real findings, now fixed in the tests: the legacy fragment path requires COMBINING_BACKSPACE_DELETES_GESTURE_WORD=false (defaults true, else line ~1339 bails to whole-word delete), and the monotonicity loops must stop at empty (the mock IC throws on delete-from-empty; real editors no-op).

Verification

:app:testOfflineDebugUnitTest --tests "*InputLogicTest"103 completed, 3 failed, 1 skipped. The 3 failures are the AGENTS.md-documented pre-existing ones (...AutospaceIndicator, insertLetterIntoWordHangulFails, revert autocorrect on delete) — unchanged baseline. All 9 active corpus tests green; 0 new failures.

Adds 10 backspace regression tests to InputLogicTest (the #31 safety net):
default per-char delete (composing/committed/recompose), the PR-#11
'precool' word-mash corruption guard, combining whole-word delete,
cursor-in-middle recompose, legacy fragment-pop, and two monotonicity
invariants. Assertions are observable (editor + composing text) only, so
they survive the #31 input-unit-stack refactor that removes
mGestureFragmentBoundaries. The multi-stroke gesture-extension case is
@ignore'd (not JVM-simulable; documented for on-device verification).

9 active tests green; 1 @ignore; no new failures vs the InputLogicTest
baseline (3 pre-existing env failures unchanged).
@AsafMah AsafMah merged commit 93fc7b4 into dev Jun 10, 2026
1 check passed
@AsafMah AsafMah deleted the feat/a3b-backspace-corpus branch June 10, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant